/**
 *	This file is part of GMMidiLib.
 *	Copyright 2009, Gabriel G Mendonça (gabrielgmendonca@gmail.com)
 *
 *  GMMidiLib is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  GMMidiLib is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with GMMidiLib.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
package br.mm.midi;

/**
 * @author mendonça
 * 
 */
public enum Note {
	C, Cs, D, Ds, E, F, Fs, G, Gs, A, As, B;

	/**
	 * Obtains a Note based on a midi message data byte.
	 * 
	 * @param data
	 *            - the midi message's data byte, between 0-127
	 * @return the corresponding Note
	 */
	public static Note getNote(int data) {
		int noteIndex = data % 12;
		return values()[noteIndex];
	}
}
